home *** CD-ROM | disk | FTP | other *** search
File List | 1986-10-19 | 12.4 KB | 484 lines |
- ' *******************
- ' *** PRINTER.LST ***
- ' *******************
- '
- DEFWRD "a-z"
- '
- > PROCEDURE printer.ready
- ' *** test if printer ready
- LOCAL k
- DO
- EXIT IF GEMDOS(&H11)
- SOUND 1,10,12,4,25
- SOUND 1,10,6,4,25
- SOUND 1,10,12,4,50
- SOUND 1,0
- ALERT 3," printer| | not ready !!",1," OK ",k
- LOOP
- RETURN
- ' **********
- '
- > PROCEDURE initio.epson.fx80
- ' *** initialize global printer-variables for Epson FX-80
- '
- lf$=CHR$(10)
- ff$=CHR$(12)
- bs$=CHR$(8)
- '
- DEFFN right.margin$(n)=CHR$(27)+"Q"+CHR$(n)
- DEFFN left.margin$(n)=CHR$(27)+"l"+CHR$(n)
- DEFFN bit.image.8$(mode,dots)=CHR$(27)+"*"+CHR$(mode)+CHR$(dots MOD 256)+CHR$(dots\256)
- DEFFN line.space$(n)=CHR$(27)+"3"+CHR$(n) ! n/216 inch (default 32/216)
- '
- elite$=CHR$(27)+"M"
- pica$=CHR$(27)+"P"
- proportional.on$=CHR$(27)+"p"+CHR$(1)
- proportional.off$=CHR$(27)+"p"+CHR$(0)
- enlarged.on$=CHR$(27)+"W"+CHR$(1)
- enlarged.off$=CHR$(27)+"W"+CHR$(0)
- condensed.on$=CHR$(15)
- condensed.off$=CHR$(18)
- emphasized.on$=CHR$(27)+"E"
- emphasized.off$=CHR$(27)+"F"
- italic.on$=CHR$(27)+"4"
- italic.off$=CHR$(27)+"5"
- underline.on$=CHR$(27)+"-"+CHR$(1)
- underline.off$=CHR$(27)+"-"+CHR$(0)
- '
- unidirectional$=CHR$(27)+"U"+CHR$(1)
- bidirectional$=CHR$(27)+"U"+CHR$(0)
- '
- initialize$=CHR$(27)+"@"
- '
- RETURN
- ' **********
- '
- > PROCEDURE high.screendump.epson.fx80
- ' *** screendump to Epson FX-80 (correct height/width ratio)
- ' *** High-resolution only
- ' *** uses Standard Globals
- LOCAL m$,b$,k,scrn.start%,col,b%,x,d%,p
- IF high.res!
- m$=" this screendump will| take about 2 minutes"
- m$=m$+"| (abort dump with <Esc>)"
- b$=" OK | Abort "
- ALERT 1,m$,1,b$,k
- IF k=1
- DO
- EXIT IF GEMDOS(&H11)
- m$=" printer| | not ready !!"
- b$=" OK "
- SOUND 1,10,12,4,25
- SOUND 1,10,6,4,25
- SOUND 1,10,12,4,50
- SOUND 1,0
- ALERT 3,m$,1,b$,k
- LOOP
- HIDEM
- '
- lf$=CHR$(10)
- ff$=CHR$(12)
- DEFFN bit.image.8$(mode,dots)=CHR$(27)+"*"+CHR$(mode)+CHR$(MOD(dots,256))+CHR$(dots/256)
- DEFFN line.space$(n)=CHR$(27)+"3"+CHR$(n) ! n/216 inch (default 32/216)
- initialize$=CHR$(27)+"@"
- scrn.start%=XBIOS(2)
- '
- LPRINT initialize$;
- LPRINT lf$;lf$
- FOR col=0 TO 79
- b%=scrn.start%+col
- LPRINT SPC(12);
- LPRINT @line.space$(24); ! 8 dots/line
- LPRINT @bit.image.8$(5,400); ! 72 dots/inch ("plotter") ; 400 dots/line
- FOR x=399 TO 0 STEP -1
- d%=ADD(b%,MUL(x,80))
- p=BYTE{d%}
- OUT 0,p
- NEXT x
- LPRINT
- EXIT IF INKEY$=esc$
- NEXT col
- LPRINT ff$;
- LPRINT initialize$;
- ENDIF
- ELSE
- m$="Sorry,|High rez|only !!"
- ALERT 3,m$,1," OK ",k
- ENDIF
- RETURN
- ' **********
- '
- > PROCEDURE download.epson.fx80
- ' *** put original Epson ROM-characters in Download Character Set
- LPRINT CHR$(27);":";CHR$(0);CHR$(0);CHR$(0);
- ' *** select Download Character Set for printing
- LPRINT CHR$(27);"%";CHR$(1);CHR$(0);
- ' *** load new characters into RAM of Epson-printer
- ' *** download 32-126 (ASCII) or 160-254
- ' *** in last case no italics possible !
- ' *** attribute 139 if no descender; otherwise 11 ("lower" 8 dots of 9)
- RESTORE dwnload.characters
- READ code
- REPEAT
- READ attribute
- LPRINT CHR$(27);"&";CHR$(0);CHR$(code);CHR$(code);CHR$(attribute);
- FOR n=1 TO 11
- READ bit.pattern
- LPRINT CHR$(bit.pattern);
- NEXT n
- READ code
- UNTIL code<0
- '
- ' *** ASCII-code, attribute, 11 bit-patterns; 12th bit-pattern always 0
- dwnload.characters:
- DATA 160,139
- DATA 0,4,10,32,10,96,138,32,28,2,0
- DATA 161,139
- DATA 0,0,18,0,94,128,2,0,0,0,0
- DATA 162,139
- DATA 0,28,34,0,34,64,162,0,34,28,0
- DATA 163,139
- DATA 0,60,2,0,66,128,2,0,60,2,0
- DATA 171,139
- DATA 0,0,248,2,12,48,194,20,34,8,50
- DATA 172,139
- DATA 0,0,248,2,12,48,204,16,36,75,4
- DATA 189,139
- DATA 0,56,68,0,186,68,170,0,68,56,0
- DATA 221,139
- DATA 0,0,80,170,0,170,0,170,20,0,0
- DATA 222,139
- DATA 0,8,0,16,0,32,0,16,0,8,0
- DATA 223,139
- DATA 0,16,40,0,32,16,8,0,40,16,0
- DATA 227,139
- DATA 0,32,64,62,64,32,0,62,64,0,0
- DATA 228,139
- DATA 0,130,68,170,16,130,0,130,0,130,0
- DATA 240,139
- DATA 0,73,0,73,0,73,0,73,0,73,0
- DATA 241,139
- DATA 0,17,0,17,0,125,0,17,0,17,0
- DATA 242,139
- DATA 0,0,131,0,69,0,41,0,17,0,0
- DATA 243,139
- DATA 0,0,17,0,41,0,69,0,131,0,0
- DATA 247,139
- DATA 0,36,72,0,72,36,18,0,18,36,0
- DATA 248,139
- DATA 0,0,0,64,160,0,160,64,0,0,0
- DATA 251,139
- DATA 0,0,32,16,8,16,32,64,128,0,128
- DATA 253,139
- DATA 0,0,0,72,144,8,160,8,192,8,0
- DATA 254,139
- DATA 0,0,16,136,0,168,0,168,80,0,0
- DATA -1
- RETURN
- ' **********
- '
- > PROCEDURE initio.star24
- ' *** initializes global printer-variables for Star LC24-10
- ' *** consult your printer-manual for the following (and other) commands
- ' *** DIP-switch settings :
- ' 1-1 OFF 2-1 ON
- ' 1-2 ON 2-2 ON
- ' 1-3 OFF 2-3 ON
- ' 1-4 ON 2-4 ON
- ' 1-5 ON 2-5 OFF
- ' 1-6 ON 2-6 OFF
- ' 1-7 ON 2-7 ON
- ' 1-8 ON 2-8 ON
- '
- LOCAL c$,f$
- '
- c$=CHR$(27)
- f$=CHR$(28)
- '
- draft.char$=c$+"x0"
- lq.char$=c$+"x1"
- '
- courier.style$=c$+"k0"+lq.char$
- prestige.style$=c$+"k2"+lq.char$
- orator.style$=c$+"k3"+lq.char$
- script.style$=c$+"k4"+lq.char$
- '
- normal.char$=c$+"q0"
- outlined.char$=c$+"q1"
- shadow.char$=c$+"q2"
- outlined.shadow.char$=c$+"q3"
- '
- italic.on$=c$+"4"
- italic.off$=c$+"5"
- '
- emphasized.on$=c$+"E"
- emphasized.off$=c$+"F"
- '
- LET double.on$=c$+"G"
- LET double.off$=c$+"H"
- '
- underline.on$=c$+"-1"
- underline.off$=c$+"-0"
- overline.on$=c$+"_1"
- overline.off$=c$+"_0"
- '
- bold.draft$=draft.char$+emphasized.on$+double.on$
- bold.lq$=lq$+double.on$
- bold.off$=emphasized.off$+double.off$
- '
- superscript.on$=c$+"S0"
- superscript.off$=c$+"T"
- subscript.on$=c$+"S1"
- subscript.off$=c$+"T"
- '
- DEFFN international.set$(n)=c$+"R"+CHR$(n)
- usa.set=0
- france.set=1
- germany.set=2
- england.set=3
- denmark1.set=4
- sweden.set=5
- italy.set=6
- spain1.set=7
- japan.set=8
- norway.set=9
- denmark2.set=10
- spain2.set=11
- latin.set=12
- denmark.norway.set=13
- '
- epson.set$=c$+"t0"
- ibm.set$=c$+"t1"+c$+"6"
- DEFFN special.on$(n)=c$+"\"+CHR$(MOD(n,256))+CHR$(DIV(n,256))
- DEFFN ibm.special$(n)=c$+"^"+CHR$(n)
- DEFFN epson.special$(n)=ibm.set$+@ibm.special$(n)+epson.set$ ! 0 ≤ n ≤ 32
- '
- slash.zero$=c$+"~1"
- normal.zero$=c$+"~0"
- '
- pica$=c$+"P"
- '
- elite$=c$+"M"
- high.speed.elite$=draft.char$+elite$+f$+"S1"
- high.density.elite$=draft.char$+elite$+f$+"S0"
- '
- semi.condensed$=c$+"g"
- condensed.on$=CHR$(15)
- condensed.off$=CHR$(18)
- '
- large.on$=c$+"W1"
- large.off$=c$+"W0"
- large.line$=CHR$(14)
- '
- courier.proportional$=courier.style$+c$+"p1"
- prestige.proportional$=prestige.style$+c$+"p1"
- proportional.off$=c$+"p0"
- '
- DEFFN master.mode$(n)=c$+"!"+CHR$(n)
- underline=128
- italic=64
- expanded=32
- LET double.strike=16
- emphasized=8
- condensed=4
- proportional=2
- elite=1
- '
- DEFFN increase.space$(n)=c$+" "+CHR$(n)
- '
- normal.size$=c$+"h"+CHR$(0)
- LET double.size$=c$+"h"+CHR$(1)
- quad.size$=c$+"h"+CHR$(2)
- LET double.height$=c$+"w1"
- normal.height$=c$+"w0"
- normal.width$=f$+"E"+CHR$(0)
- LET double.width$=f$+"E"+CHR$(1)
- triple.width$=f$+"E"+CHR$(2)
- '
- lf$=CHR$(10)
- DEFFN lf$(n)=c$+"f1"+CHR$(n)
- rev.lf$=c$+CHR$(10)
- '
- ff$=CHR$(12)
- rev.ff$=c$+CHR$(12)
- '
- DEFFN top.margin$(t)=c$+"c"+CHR$(t)
- DEFFN bottom.margin$(b)=c$+"N"+CHR$(b)
- cancel.tb.margins$=c$+"O"
- '
- DEFFN set.margins$(l,r)=c$+"X"+CHR$(l)+CHR$(r)
- DEFFN all.margins$(t,b,l,r)=@top.margin$(t)+@bottom.margin$(b)+@set.margins$(l,r)
- '
- justify.left$=c$+"a0"
- justify.right$=c$+"a2"
- justify.full$=c$+"a3"
- center$=c$+"a1"
- '
- immediate.on$=c$+"i1"
- immediate.off$=c$+"i0"
- '
- off.line$=CHR$(19)
- on.line$=CHR$(17)
- '
- bidirectional$=c$+"U0"
- unidirectional$=c$+"U1"
- '
- reset$=c$+"@"
- '
- RETURN
- ' **********
- '
- > PROCEDURE high.screendump.star24
- ' *** screendump to Star LC24-10 (actually larger than screen !)
- ' *** each byte 'enlarged' to 3 bytes (1 set bit -> 3 bits)
- ' *** High-resolution only
- ' *** uses Standard Globals
- LOCAL m$,b$,k,scrn.start%,col,b%,x,d%,p|,b1|,b2|,b3|,n
- IF high.res!
- m$=" screendump| will last| several minutes"
- m$=m$+"| (abort dump with <Esc>)"
- b$=" OK | Abort "
- ALERT 1,m$,1,b$,k
- IF k=1
- DO
- EXIT IF GEMDOS(&H11)
- m$=" printer| | not ready !!"
- b$=" OK "
- SOUND 1,10,12,4,25
- SOUND 1,10,6,4,25
- SOUND 1,10,12,4,50
- SOUND 1,0
- ALERT 3,m$,1,b$,k
- LOOP
- HIDEM
- '
- lf$=CHR$(10)
- ff$=CHR$(12)
- DEFFN bit.image$(mode,dots)=CHR$(27)+"*"+CHR$(mode)+CHR$(MOD(dots,256))+CHR$(dots/256)
- DEFFN line.space$(n)=CHR$(27)+"3"+CHR$(n) ! n/216 inch (default 32/216)
- initialize$=CHR$(27)+"@"
- scrn.start%=XBIOS(2)
- '
- LPRINT initialize$;
- FOR col=0 TO 79
- b%=scrn.start%+col
- LPRINT SPC(8); ! Elite-mode !!
- LPRINT @line.space$(24); ! 24 dots/line
- LPRINT @bit.image$(33,800); ! 120 dots/inch (double) ; 2x400 dots/line
- FOR x=399 TO 0 STEP -1
- d%=ADD(b%,MUL(x,80))
- p|=BYTE{d%}
- IF p|=0
- OUT 0,0,0,0,0,0,0
- ELSE
- CLR b1|,b2|,b3|
- IF BTST(p|,0)
- b1|=7
- ENDIF
- IF BTST(p|,1)
- ADD b1|,56
- ENDIF
- IF BTST(p|,2)
- ADD b1|,192
- b2|=1
- ENDIF
- IF BTST(p|,3)
- ADD b2|,14
- ENDIF
- IF BTST(p|,4)
- ADD b2|,112
- ENDIF
- IF BTST(p|,5)
- ADD b2|,128
- b3|=3
- ENDIF
- IF BTST(p|,6)
- ADD b3|,28
- ENDIF
- IF BTST(p|,7)
- ADD b3|,224
- ENDIF
- OUT 0,b3|,b2|,b1|,b3|,b2|,b1|
- ENDIF
- NEXT x
- LPRINT
- EXIT IF INKEY$=esc$
- NEXT col
- LPRINT ff$;
- LPRINT initialize$;
- ENDIF
- ELSE
- m$="Sorry,|High rez|only !!"
- ALERT 3,m$,1," OK ",k
- ENDIF
- RETURN
- ' **********
- '
- > PROCEDURE degas.screendump.star24
- ' *** use Degas printer-driver for screendump of logical screen
- ' *** drivers (2000 bytes) have to be loaded into INLINE-lines
- ' *** this Procedure uses drivers for the Star LC24-10 printer
- ' *** uses Procedures Make.palette.string and Printer.ready
- LOCAL buffer%,palet$,palet%,rez,screen%,command,r%,m$,k,large!
- '
- ' *** load LARGE.INL here
- INLINE star24.large.driver%,2000
- '
- ' *** load SMALL.INL here
- INLINE star24.small.driver%,2000
- '
- ERASE buffer|()
- DIM buffer|(1279)
- buffer%=V:buffer|(0)
- @make.palette.string(palet$)
- palet%=V:palet$
- rez=XBIOS(4)
- screen%=XBIOS(3)
- command=0
- @printer.ready
- m$="screendump| |1 - LARGE|2 - SMALL"
- ALERT 3,m$,0," 1 | 2 ",k
- IF k=1
- large!=TRUE
- m$="<Alternate>|for 18x11 cm,|default size|is 27x17 cm"
- ALERT 3,m$,1," OK ",k
- r%=C:star24.large.driver%(command,rez,L:screen%,L:palet%,L:buffer%)
- ELSE
- large!=FALSE
- m$="<Alternate>|for 9x5.5 cm,|default size|is 13.5x8.5 cm"
- ALERT 3,m$,1," OK ",k
- r%=C:star24.small.driver%(command,rez,L:screen%,L:palet%,L:buffer%)
- ENDIF
- SELECT BYTE(r%)
- CASE 0
- m$="Sorry, can't|initialize|printer driver| ???"
- ALERT 3,m$,1,"EDIT",k
- EDIT
- CASE 1
- m$="Abort this|screendump|with <Undo>"
- ALERT 1,m$,1," OK ",k
- command=1
- IF large!
- r%=C:star24.large.driver%(command,rez,L:screen%,L:palet%,L:buffer%)
- ELSE
- r%=C:star24.small.driver%(command,rez,L:screen%,L:palet%,L:buffer%)
- ENDIF
- DEFAULT
- m$="Printer driver|does not|function| ???"
- ALERT 3,m$,1,"EDIT",k
- EDIT
- ENDSELECT
- RETURN
- ' **********
- '
- > PROCEDURE screendump
- ' *** printer-parameters changed with Xbios 33 (Setprt)
- ' *** set for : matrixprinter, monochrome, 960 dots/line, draft,
- ' *** parallel, fanfold paper
- ' *** height/width ratio of screendump does not correspond with screen !
- ~XBIOS(33,&X100)
- HARDCOPY
- RETURN
- ' **********
- '
-